using System.Workflow.Runtime;
using DP.Sharepoint.Workflow.Tests.ForTesting;
using Microsoft.SharePoint.Workflow;

namespace DP.Sharepoint.Workflow.Tests.ForTesting
{
    public class WorkflowSharePointFixture : WorkflowBaseFixture
    {
        private ISharePointService _sharePointService; // ISharePointService 

        //private Mock _listItemService;    // IListItemService
        //private Mock _taskService;        // ITaskService 
        //private Mock _workflowModifcation; // IWorkflowModificationService

        public ISharePointService SharePointService
        {
            get { return _sharePointService; }
        }

        //public Mock SharePointServiceMock
        //{
        //    get { return _sharePointService; }
        //}

        //public ITaskService TaskService
        //{
        //    get { return _taskService.MockedInstance as ITaskService; }
        //}

        //public IListItemService ListItemService
        //{
        //    get { return _listItemService.MockedInstance as IListItemService; }
        //}

        //public IWorkflowModificationService WorkflowModifcation
        //{
        //    get { return _workflowModifcation.MockedInstance as IWorkflowModificationService; }
        //}

        //public Mock ListItemServiceMock
        //{
        //    get { return _listItemService; }
        //}

        //public Mock TaskServiceMock
        //{
        //    get { return _taskService; }
        //}

        //public Mock WorkflowModifcationMock
        //{
        //    get { return _workflowModifcation; }
        //}

        private void BuildServices()
        {
            _sharePointService = new StubSharePointService(); //MockManager.MockObject<ISharePointService>();
            //_workflowModifcation = MockManager.MockObject<IWorkflowModificationService>();
            //_taskService = MockManager.MockObject<ITaskService>();
            //_listItemService = MockManager.MockObject<IListItemService>();
        }


        public override void AddServices(WorkflowRuntime runtime)
        {
            base.AddServices(runtime);

            BuildServices();

            AddExternalDataService(SharePointService);

            //AddExternalDataService(WorkflowModifcation);
            //AddExternalDataService(TaskService);
            //AddExternalDataService(ListItemService);
        }
    }
}